﻿@{
    ViewBag.Title = "Hiệu chỉnh sơ đồ địa bàn";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

@Scripts.Render("~/bundles/jsMap")
<script type="text/javascript" src="http://viettelmap.vn/VTMapService/VTMapAPI?api=VTMap&type=main&k=dffc8675fc5d781ea8f0131f7d855565"></script>
@Scripts.Render("~/Scripts/Polygon.js")
@Scripts.Render("~/Scripts/PolygonEditor.js")
@Scripts.Render("~/Scripts/PolygonOptions.js")
@Scripts.Render("~/Scripts/MVCArray.js")
@Scripts.Render("~/Scripts/jsMapArea.js")

<script src="~/Scripts/Airview-master/vendor/tooltip.min.js"></script>
<script src="~/Scripts/Airview-master/airview.min.js"></script>
<link href="@Url.Content("~/Content/styleMap_navbar.css")" rel="stylesheet" type="text/css" />

<script>
    @functions{
        public string GetAntiForgeryToken()
        {
            string cookieToken, formToken;
            AntiForgery.GetTokens(null, out cookieToken, out formToken);
            return cookieToken + "," + formToken;
        }
    }
    var strUrlAddBP = '@Url.Action("AddAreaBoundPoint", "Area")';
    var strUrlGetAreaCode = '@Url.Action("GetAreaBoundPointByAreaCode", "Area")';
    var headers = {};
    $(document).ready(function () {
        var serviceUrl = null;
        var strCommuneCode = null;
        serviceUrl = '@ViewBag.ServiceUrl';
        strCommuneCode = '@ViewBag.CommuneCode';
        loadMapToDraw("1", serviceUrl, strCommuneCode);
        window.onload = function () {
            headers['VerificationToken'] = '@GetAntiForgeryToken()';
        }

        $('#close1').click(function () {
            $('#success').hide(1000);
        });

        $('#close2').click(function () {
            $('#success').hide(1000);
        });

    });

    $(document).bind("keypress", function (e) {
        if (e.keyCode === 27) {
            $('#success').hide(1000);
        }
    });


</script>
<style>

</style>
<div class="full-height-content">
    <div class="full-height-content-body" style="overflow:hidden;">
        <div>
            <div id='map' class="map_content">
            </div>
            <div class="area_detail_map m1" style="">
                <ul class="inline" style="float: left; width: 150px; padding: 0px;">
                    <li style="display:inline;">
                        <button id="strChucNang1" title="Xem bản đồ" value="1111">
                            <img src="../Images/map/magnifier-128.png" data-content="magnifier-128.png" width="23" id="map_view">
                        </button>
                    </li>
                    <li style="display:inline;">
                        <button id="strChucNang2" value="2222" title="Hiệu chỉnh">
                            <img src="../Images/map/Map.png" data-content="Map.png" width="23" id="map_edit">
                        </button>
                    </li>
                    <li style="display:inline;">
                        <button id="EditMap" title="Lưu">
                            <img src="../Images/map/Floppy-Disk-icon.png" data-content="Floppy-Disk-icon.png" width="23" id="map_save">
                        </button>
                    </li>
                </ul>
                <div id="optionDiaBanDieuTra" class=" m1" style="float:left;width:200px;">
                    @Html.DropDownList("selectDiBanDieuTra", ViewData["LIST_AREA"] as List<SelectListItem>, "Chọn địa bàn điều tra", new { @class = "form-control input-sm" })
                </div>
            </div>

            <div id='divMapPrint'></div>

            <div id="success" class="modal-dialog" style="display: none; min-width: 150px; max-width: 380px; position: absolute; z-index: 1000; margin-left:30%; margin-top:15%;" tabindex="-1">
                <div class="modal-content">
                    <div class="modal-body">
                        <button id="close1" class="bootbox-close-button close" aria-hidden="true" data-dismiss="modal" type="button">×</button>
                        <h4 class="modal-title" style="text-align:center;"><b> Địa bàn đã được cập nhật thành công. </b></h4>
                    </div>
                    <div class="modal-footer">
                        <button id="close2" class="btn btn-default">
                            <i class="fa fa-times"></i> Đóng
                        </button>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>